package admin

import (
	"fmt"
	"gin-demo/controllers"
	"gin-demo/pkg/e"
	"github.com/gin-gonic/gin"
	"net/http"
)

type Login struct {
	Username string `form:"username" json:"username" binding:"required"`
	Password string `form:"password" json:"password" binding:"required"`
}

type LoginController struct {
	controllers.BaseController
}

func (con LoginController) Index(c *gin.Context) {
	con.PanicHandler(http.StatusOK)
	username := c.GetString("username")
	//userInfo, _ := c.Get("userInfo")
	maxHeaderBytes := 1 << 20
	fmt.Println(maxHeaderBytes)
	fmt.Println(username)
	//fmt.Println(userInfo)
	//fmt.Println(userInfo.(map[string]interface{})["name"].(string))
	//c.String(http.StatusOK, "用户列表--"+username)
	con.Response(http.StatusOK, e.SUCCESS, username)
}
